// custom-tab-bar/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    selected:0,
    position: "bottom",
    backgroundColor: "#B7DEA3",
    borderStyle: "white",
    selectedColor: "white",
    color:"#969696",
    "list": [
      {
      "current":0,
      "pagePath": "/pages/index/index",
      "text": "首页",
      "iconPath": "/pages/index/images/barImg1.png",
      "selectedIconPath": "/pages/index/images/barImg1.png"
    },
    {
      "current":1,
      "pagePath": "/pages/selectRecord/index",
      "text": "记录",
      "iconPath": "/pages/index/images/barImg2.png",
      "selectedIconPath": "/pages/index/images/barImg2.png"
    },
    {
      "current":2,
      "pagePath": "/pages/getOpenId/index",
      "text": "我的",
      "iconPath": "/pages/index/images/barImg3.png",
      "selectedIconPath": "/pages/index/images/barImg3.png"
    }
  ]
  },
  attached(){
  },

  /**
   * 组件的方法列表
   */
  methods: {
    switchTab(e) {
      console.log(e);
      const idx = e.currentTarget.dataset.index
      const path = e.currentTarget.dataset.path
      this.setData({
        selected: idx,
       })
      wx.switchTab({
        url: path,
      });
    }
  }
})
